package com.ciaojian.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ciaojian.core.enums.business.WorkerApplyStatusEnum;
import com.ciaojian.core.model.vo.WorkerInfoVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 排班审核表
 * </p>
 *
 * @author Atlakyn
 * @since 2021-03-30
 */
@Data
@ApiModel
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("d_scheduling_examine")
public class SchedulingExamine extends Model<SchedulingExamine> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(hidden = true)
    private Long id;

    @ApiModelProperty(value = "门店Id", required = true)
    private Integer storeId;

    @ApiModelProperty("门店名称")
    private String storeName;

    @ApiModelProperty(value = "发型师ID", required = true)
    private Integer wid;

    @ApiModelProperty(value = "申请人手机号", required = true)
    private String phone;

    @ApiModelProperty(value = "审核名称", hidden = true)
    private String name;

    @ApiModelProperty(value = "审核状态:0待审核 1通过 2驳回")
    private WorkerApplyStatusEnum status;

    @ApiModelProperty("驳回理由")
    private String disallowReason;

    @ApiModelProperty(value = "审核人", hidden = true)
    private String operator;

    @TableField(exist = false)
    @ApiModelProperty(hidden = true)
    private WorkerInfoVO worker;

    @ApiModelProperty("开始日期")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date beginDate;

    @ApiModelProperty("结束日期")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date endDate;

    @ApiModelProperty("已读")
    @TableField("`read`")
    private Boolean read;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "逻辑删除", hidden = true)
    private Boolean logicDel;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}